﻿#region using statements

using Microsoft.Xna.Framework.Input;

#endregion

namespace XNAGameEngine.Input
{
    /// <summary>
    /// <para>Interface that allows objects to register for receiving input events.\n</para>
    /// <para>Also allows for specific buttons to be tested individually.</para>
    /// </summary>
    public interface IManagerInput
    {
        #region local methods

        /// <summary>
        /// Whether the specified key is currently down
        /// </summary>
        /// <param name="key">the key to test</param>
        /// <returns>true if the key is down, false otherwise</returns>
        bool IsKeyPressed(Keys key);

        /// <summary>
        /// Whether the specified key is down for the first time this frame
        /// </summary>
        /// <param name="key">the key to test</param>
        /// <returns>true if the key was pressed this frame, false otherwise</returns>
        bool WasKeyPressed(Keys key);

        /// <summary>
        /// Whether the specified key is up for the first time this frame
        /// </summary>
        /// <param name="key">the key to test</param>
        /// <returns>true if the key was released this frame, false otherwise</returns>
        bool WasKeyReleased(Keys key);

        /// <summary>
        /// Whether the specified key has been down for more than one frame
        /// </summary>
        /// <param name="key">the key to test</param>
        /// <returns>true if the key was held since the last frame, false otherwise</returns>
        bool WasKeyHeld(Keys key);

        /// <summary>
        /// Change the input listening status of the object passed in to the bool value passed in
        /// </summary>
        /// <param name="newListeningState">pass in true to have it listen to input, false to have it stop listening to input</param>
        /// <param name="newListener">the object to change. Must implement interface "IManagerInputCallbacks"</param>
        void ToggleInputListening(bool newListeningState, object newListener);

        #endregion
    }
}